class DataStream
{
public:
    DataStream(int value, int k)
    {
        this->k = k;
        this->value = value;
    }

    bool consec(int num)
    {
        if (num == last)
        {
            ++consecutiveCount;
        }
        else
        {
            consecutiveCount = 1;
            last = num;
        }
        return (last == value) && (consecutiveCount >= k);
    }

private:
    int consecutiveCount;
    int last;
    int k;
    int value;
};

/**
 * Your DataStream object will be instantiated and called as such:
 * DataStream* obj = new DataStream(value, k);
 * bool param_1 = obj->consec(num);
 */